package communication;

import java.io.IOException;
import java.net.ServerSocket;

public class ServerConnection {

	private ServerSocket serverSocket;

	public ServerConnection(int port) throws IOException {
		serverSocket = new ServerSocket(port);
	}

	public SocketConnection accept() throws IOException {
		return new SocketConnection(serverSocket.accept());
	}

	public void close() throws IOException {
		serverSocket.close();
	}
}
